package com.jiandian.zh.api.common.service;

import com.github.pagehelper.PageInfo;
import com.jiandian.zh.api.common.domain.BaseDomain;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author lik
 */
@Transactional(readOnly = true)
@Service
public interface BaseService<T extends BaseDomain>  {
    @Transactional(readOnly = false)
    int insert(T t, String createBy);

    @Transactional(readOnly = false)
    int delete(T t);

    @Transactional(readOnly = false)
    int update(T t, String updateBy);

    T selectOne(T t);

    PageInfo<T> selectPage(int pageNum, int pageSize, T t);

    int selectCount(T t);

    T selectByPrimaryKey(String primaryKey);

    @Transactional(readOnly = false)
    int deleteByPrimaryKey(String primaryKey);


}
